home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / includ~1.z / includ~1 / pmluser.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-10-11  |  4.1 KB  |  157 lines

  1. #ifndef _PMLUSER_H
  2. #define _PMLUSER_H
  3.  
  4. /************************************************************************
  5.  *                                    *
  6.  *                N O T I C E                *
  7.  *                                    *
  8.  *            Copyright Abandoned, 1987, Fred Fish        *
  9.  *                                    *
  10.  *    This previously copyrighted work has been placed into the    *
  11.  *    public domain by the author (Fred Fish) and may be freely used    *
  12.  *    for any purpose, private or commercial.  I would appreciate    *
  13.  *    it, as a courtesy, if this notice is left in all copies and    *
  14.  *    derivative works.  Thank you, and enjoy...            *
  15.  *                                    *
  16.  *    The author makes no warranty of any kind with respect to this    *
  17.  *    product and explicitly disclaims any implied warranties of    *
  18.  *    merchantability or fitness for any particular purpose.        *
  19.  *                                    *
  20.  ************************************************************************
  21.  */
  22.  
  23.  
  24. /*
  25.  *  FILE
  26.  *
  27.  *    pmluser.h    include file for users of portable math library
  28.  *
  29.  *  SYNOPSIS
  30.  *
  31.  *    #include <pmluser.h>
  32.  *
  33.  *  DESCRIPTION
  34.  *
  35.  *    This file should be included in any user compilation module
  36.  *    which accesses routines from the Portable Math Library (PML).
  37.  *
  38.  */
  39.  
  40.  
  41. /*
  42.  *    Create the type "COMPLEX".  This is an obvious extension that I
  43.  *    hope becomes a part of standard C someday.
  44.  *
  45.  */
  46.  
  47. typedef struct cmplx {            /* Complex structure */
  48.     double real;            /* Real part */
  49.     double imag;            /* Imaginary part */
  50. } COMPLEX;
  51.  
  52. /* exceptions ++jrb */
  53. typedef enum  { DOMAIN, OVERFLOW, UNDERFLOW, PLOSS, SING } exception_type;
  54.  
  55. struct exception {
  56.     exception_type    type;    /* exception type */
  57.     char        *name;    /* function in which it occured */
  58.     double        arg1;    /* an arg */
  59.     double        retval; /* val to return */
  60. };
  61.  
  62. static unsigned long __huge[2] = { 0x7ff00000L, 0L }; /* ieee infinity */
  63. #define HUGE  (*((double *)&__huge[0]))
  64.  
  65. #ifndef atarist
  66. #include <std.h>
  67. #endif
  68.  
  69. #if ((defined(__STDC__)) && (!defined(__NO_PROTO__)))
  70. double acos(double);
  71. double acosh(double);
  72. double asin(double);
  73. double asinh(double);
  74. double atan(double);
  75. double atan2(double, double);
  76. double atanh(double);
  77. double cabs(COMPLEX);
  78. double cos(double);
  79. double cosh(double);
  80. double dabs(double);
  81. double fabs(double);
  82. double exp(double);
  83. double log(double);
  84. double log10(double);
  85. int matherr(struct exception *);
  86. double max(double, double);
  87. double min(double, double);
  88. double mod(double, double);
  89. int pmlcfs(int, int);
  90. int pmlcnt(void);
  91. int pmlerr(int);
  92. int pmllim(int);
  93. int pmlsfs(int, int);
  94. double poly(int, double *, double);
  95. double sign(double, double);
  96. double sin(double);
  97. double sinh(double);
  98. double sqrt(double);
  99. double tan(double);
  100. double tanh(double);
  101. double floor(double);
  102. double ceil(double);
  103. double pow(double, double);
  104. double rint(double);
  105. double modf(double, double *);
  106. double ldexp(double, int);
  107. #ifdef __MSHORT__
  108. double frexp(double, short *);
  109. #else
  110. double frexp(double, int *);
  111. #endif
  112.  
  113. #else
  114.  
  115. extern double acos(/* double */);
  116. extern double acosh(/* double */);
  117. extern double asin(/* double */);
  118. extern double asinh(/* double */);
  119. extern double atan(/* double */);
  120. extern double atan2(/* double, double */);
  121. extern double atanh(/* double */);
  122. extern double cabs(/* COMPLEX */);
  123. extern double cos(/* double */);
  124. extern double cosh(/* double */);
  125. extern double dabs(/* double */);
  126. extern double fabs(/* double */);
  127. extern double exp(/* double */);
  128. extern double log(/* double */);
  129. extern double log10(/* double */);
  130. extern int matherr(/* struct exception * */);
  131. extern double max(/* double, double */);
  132. extern double min(/* double, double */);
  133. extern double mod(/* double, double */);
  134. extern int pmlcfs(/* int, int */);
  135. extern int pmlcnt(/*  */);
  136. extern int pmlerr(/* int */);
  137. extern int pmllim(/* int */);
  138. extern int pmlsfs(/* int, int */);
  139. extern double poly(/* int, double *, double */);
  140. extern double sign(/* double, double */);
  141. extern double sin(/* double */);
  142. extern double sinh(/* double */);
  143. extern double sqrt(/* double */);
  144. extern double tan(/* double */);
  145. extern double tanh(/* double */);
  146. extern double floor(/* double */);
  147. extern double ceil(/* double */);
  148. extern double pow(/* double, double */);
  149. extern double rint(/* double */);
  150. extern double modf(/* double, double * */);
  151. extern double ldexp(/* double, int */);
  152. extern double frexp(/* double, int * */);
  153.  
  154. #endif /* __STDC__ */
  155.  
  156. #endif /* _PMLUSER_H */
  157.